export default class JWTTokenCacheVO  { 
  accId!:string;
  accessTokenId!:string;
  /**权限令牌 */
  accessToken!:string;
  accessTokenExpSeconds!:string;
  accessTokenExpTime!:string;
  refreshTokenId!:string;
  refreshToken!:string;
  refreshTokenExpSeconds!:string;
  refreshTokenExpTime!:string;
  ipAddr!:string;


  /**通过JSONObject创建实例对象 */
  public static getInstanceByJSONObj(jsonObj:any):JWTTokenCacheVO{  
    let instance=new JWTTokenCacheVO()  
    return Object.assign(instance, jsonObj) 
  }


  /** 通过属性参数创建实例对象 */
  public static getInstanceByParam(accId:string,accessTokenId:string
                                   ,accessToken:string,accessTokenExpSeconds:string
                                   ,accessTokenExpTime:string,refreshTokenId:string
                                   ,refreshToken:string,refreshTokenExpSeconds:string
                                   ,refreshTokenExpTime:string,ipAddr:string){ 
    let instance=new JWTTokenCacheVO()  
    instance.accId=accId;
    instance.accessTokenId=accessTokenId;
    instance.accessToken=accessToken;
    instance.accessTokenExpSeconds=accessTokenExpSeconds;
    instance.accessTokenExpTime=accessTokenExpTime;
    instance.refreshTokenId=refreshTokenId;
    instance.refreshToken=refreshToken;
    instance.refreshTokenExpSeconds=refreshTokenExpSeconds;
    instance.refreshTokenExpTime=refreshTokenExpTime;
    instance.ipAddr=ipAddr;
    return instance 
  }


  /** 类属性的申明静态变量(适用于直接用到Class.fieldName的场景) */
   static fieldNames={
       accId:"accId",
      accessTokenId:"accessTokenId",
      accessToken:"accessToken",
      accessTokenExpSeconds:"accessTokenExpSeconds",
      accessTokenExpTime:"accessTokenExpTime",
      refreshTokenId:"refreshTokenId",
      refreshToken:"refreshToken",
      refreshTokenExpSeconds:"refreshTokenExpSeconds",
      refreshTokenExpTime:"refreshTokenExpTime",
      ipAddr:"ipAddr" } 
}

